package com.sc.nft.dao;

import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import lombok.extern.slf4j.Slf4j;
import com.sc.nft.entity.UserSynthesisDetailsRecord;
import com.sc.nft.mapper.UserSynthesisDetailsRecordMapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Repository;

import java.util.ArrayList;

/**
 * 合计记录-消耗藏品详情(sc_user_synthesis_details_record)数据DAO
 *
 * @author Sun
 * @since 2024-07-16 11:58:07
 * @description 由 Mybatisplus Code Generator 创建
 */
@Slf4j
@Repository
public class UserSynthesisDetailsRecordDao extends ServiceImpl<UserSynthesisDetailsRecordMapper, UserSynthesisDetailsRecord> {

    public boolean updateRecordIdByIds(ArrayList<Long> ids, Long recordId) {
        LambdaUpdateWrapper<UserSynthesisDetailsRecord> wrapper = new LambdaUpdateWrapper<>();
        wrapper.in(UserSynthesisDetailsRecord::getId,ids);
        wrapper.set(UserSynthesisDetailsRecord::getRecordId,recordId);
        return update(new UserSynthesisDetailsRecord(),wrapper);
    }
}